import { NativeModules } from 'react-native';
import { isIOS } from '../../constant';

const setAliPaySandbox = (sandbox: boolean): void => {
  if (isIOS) return;
  NativeModules.Alipay.setAlipaySandbox(sandbox);
};

const pay = (orderInfo: string): Promise<any> =>
  NativeModules.Alipay.pay(orderInfo);

export default {
  setAliPaySandbox,
  pay
};
